﻿@using SCMS.Resources
@model SCMS.UI.Models.WBill
@{AjaxOptions ajaxOpts = new AjaxOptions
  {
      UpdateTargetId = "wbDiv",
      LoadingElementId = "loading",
      HttpMethod = "Post",
      Url = Url.Action("SaveWBill"),
      OnSuccess = "initSorter();sorter.size(50);usermsgg",
      OnFailure = "javascript:errormsg()"


  };}
<script src="@Url.Content("~/Scripts/js/jquery-1.7.2.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/procument.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/js/ajax.js")" type="text/javascript"></script>
<div class="partialViewCard">
    <div class="partialViewCardHeader">
        <h3>
            @Resources_morgan.WayBill_Index_Header</h3>
    </div>
    <br />
    @using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form", @id = "frmwb" }))
    {
        @Html.ValidationSummary(true)


        <input type="hidden" id="actionStatus" value="@ViewBag.Response" />
        <input type="hidden" id="statusMsg" value="@ViewBag.msg" />
        <table width="98%" align="center">
            <tr>
                <th align="center" width="33.3%">
                    @Resources_morgan.WRForm_LoadWRF_WRFNo
                </th>
                <th align="center" width="33.3%">
                    @Resources_morgan.WayBill_LoadWB_OriginWH
                </th>
                <th align="center" width="33.3%">
                    @Resources_morgan.WayBill_LoadWB_DestinationWH
                </th>
            </tr>
            <tr>
                <td align="center">
                    @Html.DropDownListFor(x => x.EntityWBill.WRNId, Model.WRNs, Resources_frank.Global_String_PleaseSelect, new { onchange = "javascript:GetWBItems(this)" })
                    @Html.ValidationMessageFor(x => x.EntityWBill.WRNId)
                </td>
                <td align="center">
                    @Html.DropDownListFor(m => m.EntityWBill.IssuerWarehouse, Model.Warehouses, Resources_frank.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(m => m.EntityWBill.IssuerWarehouse)
                </td>
                <td align="center">
                    @Html.DropDownListFor(x => x.EntityWBill.DestinationWarehouse, Model.Warehouses, Resources_frank.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(x => x.EntityWBill.DestinationWarehouse)
                </td>
            </tr>
            <tr>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_IssuingOffice
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DateofLoading
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DateofDispatch
                </th>
            </tr>
            <tr>
                <td align="center">
                    @Html.DropDownListFor(x => x.EntityWBill.IssuingOffice, Model.IssuingOffice, Resources_frank.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(x => x.EntityWBill.IssuingOffice)
                    @*@Html.TextBoxFor(m => m.EntityWHouseRelease.RefNumber, new { @readonly = "readonly" })*@
                </td>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.LoadingDate)
                    @Html.ValidationMessageFor(m => m.EntityWBill.LoadingDate)
                </td>
                <td align="center">
                    @Html.EditorFor(x => x.EntityWBill.DispatchDate)
                    @Html.ValidationMessageFor(x => x.EntityWBill.DispatchDate)
                </td>
            </tr>
            <tr>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_Consignee
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DRCVehicleRegNo
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DRCvehicleodometerkm
                </th>
            </tr>
            <tr>
                <td align="center">
                    @Html.DropDownListFor(x => x.EntityWBill.Consignee, Model.Staff, Resources_frank.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(x => x.EntityWBill.Consignee)
                </td>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.DRCVehicleRegNo)
                    @Html.ValidationMessageFor(m => m.EntityWBill.DRCVehicleRegNo)
                </td>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.DRCVehicleMileage)
                    @Html.ValidationMessageFor(m => m.EntityWBill.DRCVehicleMileage)
                </td>
            </tr>
            <tr>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DRCvehiclecallsigncontactno
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_WBNo
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DestinationOffice
                </th>
            </tr>
            <tr>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.DRCVehicleContactNo)
                    @Html.ValidationMessageFor(m => m.EntityWBill.DRCVehicleContactNo)
                </td>
                <td align="center">
                    @Html.TextBoxFor(m => m.EntityWBill.RefNumber, new { @readonly = "readonly", id = "wbrefNo" })
                    @Html.ValidationMessageFor(m => m.EntityWBill.RefNumber)
                </td>
                <td align="center">
                    @Html.DropDownListFor(x => x.EntityWBill.DestinationOffice, Model.IssuingOffice, Resources_frank.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(x => x.EntityWBill.DestinationOffice)
                </td>
            </tr>
            <tr>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DriverName
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_TransportCompany
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_DriverLicenseNo
                </th>
            </tr>
            <tr>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.DriverName)
                    @Html.ValidationMessageFor(m => m.EntityWBill.DriverName)
                </td>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.TransportCompany)
                    @Html.ValidationMessageFor(m => m.EntityWBill.TransportCompany)
                </td>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.DriverLicenseNo)
                    @Html.ValidationMessageFor(m => m.EntityWBill.DriverLicenseNo)
                </td>
            </tr>
            <tr>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_TotalDistancekm
                </th>
                <th align="center">
                    @Resources_morgan.WayBill_LoadWB_LoadingRemarks
                </th>
                <th align="center">
                </th>
            </tr>
            <tr>
                <td align="center">
                    @Html.EditorFor(m => m.EntityWBill.DRCVehicleTotalDistance)
                    @Html.ValidationMessageFor(m => m.EntityWBill.DRCVehicleTotalDistance)
                </td>
                <td align="center">
                    @Html.TextAreaFor(m => m.EntityWBill.LoadingRemarks)
                    @Html.ValidationMessageFor(m => m.EntityWBill.LoadingRemarks)
                </td>
                <td align="center">
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    <div id="itemsDiv">
                        <table width="92%" align="center" cellspacing="0" cellpadding="0" border="1" style="border: 1px solid grey;
                            border-collapse: collapse; padding: 5px; font-size: 12px;">
                            <tr class="gridheader">
                                <td colspan="6" align="left">
                                    <h4>
                                        @Resources_morgan.WayBill_LoadWB_LOADINGDISPATCHDETAILS</h4>
                                </td>
                            </tr>
                            <tr>
                                <th style="width: 5%; text-align: center;">
                                </th>
                                <th style="width: 15%; text-align: center;">
                                    @Resources_morgan.Global_String_SerialNo
                                </th>
                                <th style="width: 30%; text-align: center;">
                                    @Resources_morgan.WayBill_LoadWB_EquipmentitemCommodity
                                </th>
                                <th style="width: 10%; text-align: center;">
                                    @Resources_morgan.Global_String_Unit
                                </th>
                                <th style="width: 17%; text-align: center;">
                                    @Resources_morgan.Global_String_Weight
                                </th>
                                <th style="width: 15%; text-align: center;">
                                    @Resources_morgan.WayBill_LoadWB_QtyDispatched
                                </th>
                            </tr>
                        </table>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    &nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td align="left">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input class="btn green" type="submit" value="  @Resources_frank.Global_String_Save  " />
                </td>
                <td>
                </td>
            </tr>
        </table>
    
    }
</div>
